package akaram.claws.tests;

import java.io.FileNotFoundException;

import junit.framework.TestCase;
import akaram.claws.Compiler;
import akaram.claws.story.ClawsProgram;

public class CompilerTest extends TestCase {
	
	private String compilation_file_test = "samples/ejemplo-prog-1.clw";
	
	public void testCompilation() {
		Compiler compiler = new Compiler();
		try {
			ClawsProgram clawprogram = compiler.compile("hghsgds");
			fail("Should be failed because of not existent file.");
		} catch (FileNotFoundException e) {
			try {
				ClawsProgram clawprogram = compiler.compile(compilation_file_test);
				assertNotNull(clawprogram);
			} catch (FileNotFoundException e1) {
				fail("No test file.");
			}
		}
	}

}
